<?php
/**
* Modul für Joomla
*/

	// error_reporting(E_ALL);
	// ini_set('display_errors', 1);

	include("lima/inc/joomlaInt.php");
	include("lima/inc/inc_configuration.php");

	
	$q = "	SELECT
				l.id,
				l.name
			FROM
				$tbl_season s,
				$tbl_leagues l
			WHERE
				s.active = 1 AND
				l.type = 1 AND
				l.seasonId = s.id";
	$qe = mysql_query($q);

	while ($row = mysql_fetch_object($qe))
	{
		$lid = $row->id;
		$lname = $row->name;
		
		echo "	<table>
					<tr>
						<th colspan='2'>$lname</th>
					</tr>";
		
		$tq = "	SELECT
					t.id,
					t.name
				FROM
					$tbl_lt lt,
					$tbl_teams t
				WHERE
					lt.leagueId = $lid AND
					lt.teamId = t.id AND
					t.vergeben = 0";
		
		$tqe = mysql_query($tq);
		
		while ($trow = mysql_fetch_object($tqe))
		{
			$tid = $trow->id;
			$tname = $trow->name;
		
			echo "	<tr>
						<td><img style='margin:0px' src='lima/img/logos/$tid.png' hspace='0' width='20' height='20'title='$tname'/></td>
						<td>$tname</td>
					</tr>";
		
		}
		
		echo "</table>";
	
	
	
	}
	
	
	
	
	
	
	
	
?>

</body>
</html>